package com.yc.spring;

import java.net.URL;

public class MyAnnotationConfigApplicationContext {

    public static void main(String[] args) {
        URL url= locConfig.class.getClassLoader().getResource("com/yc");
        System.out.println(url);
    }

//    public MyAnnotationConfigApplicationContext(Class confidClass){
//        Annotation configClassAnnotation = confidClass.getAnnotation(Configuration.class);
//        if (configClassAnnotation == null){
//            throw  new RuntimeException("不是配置类："+confidClass);
//        }
//                for (Method method:confidClass.getDeclaredMethods()){
//                    if (method.getAnnotation(Bean.class)!=null){
//
//                    }
//                }
//        ComponentScan componentScan=(ComponentScan) confidClass.getAnnotation(ComponentScan.class);
//                if (componentScan!=null){
//                    String[] packagePaths=componentScan.value();
//                    for (String packagePath:packagePaths){
//                        ClassLoader classLoader =confidClass.getClassLoader();
//                        classLoader.getResource(packagePath.replaceAll("\\.","/"));
////                        String rootPackage=url.getPath();
//                        try {
////                            rootPackage = URLDecoder.decode(rootPackage,"utf-8");
////                        }catch (UnsupportedEncodingException e){
////                            throw  new RuntimeException("编码集错误",e);
//                        }
//
//                        File rootPath =new File();
//
//                    }
//                }
//    }
}
